package com.fenmirs.bookmarks.config;

import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @auther: qijiang
 * @date: 2018/12/25 15:12
 */

@Configuration
public class MyBatisConfig {

    @Bean
    public ConfigurationCustomizer configurationCustomizer(){
        return configuration -> {
            //-自动使用驼峰命名属性映射字段   userId    user_id
            configuration.setMapUnderscoreToCamelCase(true);
            //使用列别名替换列名 select user as User
            configuration.setUseColumnLabel(true);
        };
    }
}
